<?php
use Illuminate\Http\Request;


Route::post('/auth','AuthApiController@login');
Route::middleware(['auth:admin'])->group(function () {
    Route::group(['prefix'=>'users'],function (){
        $apiController = 'UserApiController';
        Route::get('', $apiController.'@lists');
        Route::patch('',$apiController.'@patch');
        Route::put('',$apiController.'@store');
        Route::delete('/{id}',$apiController.'@destroy');
    });
    Route::group(['prefix'=>'userAccount'],function (){
        $apiController = 'UserAccountApiController';
        Route::get('', $apiController.'@lists');
    });
    Route::group(['prefix'=>'dashboard'],function (){
        $apiController = 'DashboardApiController';
        Route::get('/user',$apiController.'@user');
        Route::get('/account',$apiController.'@account');
        Route::get('/chart-user',$apiController.'@chart_user');
        Route::get('/chart-account',$apiController.'@chart_account');
    });
    Route::get('getMenu',function (){
        return config('admin.menu');
    });
});
